<p class="Paragraph"><help:paragraphinfo state="U" number="2"/>Repeats the statements between the Do and the Loop statement while the condition is True or until the condition becomes True.</p>
<p class="Paragraph"><help:paragraphinfo state="U" number="16" xmlns:help="http://openoffice.org/2000/help"/><span class="T1">Condition:</span> A comparison, numeric or string expression, that evaluates either True or False.</p>
<p class="Paragraph"><help:paragraphinfo state="U" number="17" xmlns:help="http://openoffice.org/2000/help"/><span class="T1">Statement block:</span> Statements that you want to repeat while or until the condition is True.</p>
<p class="Paragraph"><help:paragraphinfo state="U" number="18" xmlns:help="http://openoffice.org/2000/help"/>The <span class="T1">Do...Loop</span> statement executes a loop as long as, or until, a certain condition is True. The condition for exiting the loop must be entered following either the <span class="T1">Do</span> or the <span class="T1">Loop</span> statement. The following examples are valid combinations:</p>
<p class="Paragraph"><help:paragraphinfo state="U" number="24" xmlns:help="http://openoffice.org/2000/help"/>The statement block between the Do While and the Loop statements is repeated so long as the condition is true.</p>
<p class="Paragraph"><help:paragraphinfo state="U" number="25" xmlns:help="http://openoffice.org/2000/help"/>Do Until condition = True</p>
<p class="Paragraph"><help:paragraphinfo state="U" number="29" xmlns:help="http://openoffice.org/2000/help"/>The statement block between the Do Until and the Loop statements is repeated if the condition so long as the condition is false.</p>
<p class="Paragraph"><help:paragraphinfo state="U" number="32" xmlns:help="http://openoffice.org/2000/help"/>Loop While condition = True</p>
<p class="Paragraph"><help:paragraphinfo state="U" number="34" xmlns:help="http://openoffice.org/2000/help"/>The statement block between the Do and the Loop statements repeats so long as the condition is true.</p>
<p class="Paragraph"><help:paragraphinfo state="U" number="37" xmlns:help="http://openoffice.org/2000/help"/>Loop Until condition = True</p>
<p class="Paragraph"><help:paragraphinfo state="U" number="39" xmlns:help="http://openoffice.org/2000/help"/>The statement block between the Do and the Loop statements repeats until the condition is true.</p>
<p class="Paragraph"><help:paragraphinfo state="U" number="41" xmlns:help="http://openoffice.org/2000/help"/>Use the <span class="T1">Exit Do</span> statement to unconditionally end the loop. You can add this statement anywhere in a <span class="T1">Do</span>...<span class="T1">Loop</span> statement. You can also define an exit condition using the <span class="T1">If...Then</span> structure as follows:</p>